import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Home from '@/views/home/index.vue'
import MyOrder from '@/views/my-order/index.vue'
import OurMenu from '@/views/our-menu/index.vue'
import Profile from '@/views/profile/index.vue'
import Layout from "@/layout/index.vue"
import Login from "@/views/login/index.vue"
import OrderCoffee from "@/views/order-coffee/index.vue"
import HistoryOrder from "@/views/history-order/index.vue"
import MyCollection from "@/views/my-collection/index.vue"
const routes: Array<RouteRecordRaw> = [
  {
    path: "/myCollection",
    name: "myCollection",
    component: MyCollection
  },
  {
    path: "/historyOrder",
    name: "historyOrder",
    component: HistoryOrder
  },
  {
    path: "/orderCoffee",
    name: "orderCoffee",
    component: OrderCoffee
  },
  {
    path: "/login",
    name: "login",
    component: Login
  },
  {
    path: '/',
    name: 'Home',
    component: Layout,
    children: [
      { path: "", component: Home }
    ]
  },
  {
    path: '/myOrder',
    name: 'myOrder',
    component: Layout,
    children: [
      { path: "", component: MyOrder }
    ]
  },
  {
    path: '/ourMenu',
    name: 'ourMenu',
    component: Layout,
    children: [
      { path: "", component: OurMenu }
    ]
  },
  {
    path: '/profile',
    name: 'profile',
    component: Layout,
    children: [
      { path: "", component: Profile }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
